exports.articlesType = (req,res)=> { 
	 let article = global.dbHelper.getModel('article');
     let blogType = req.query.blogType;
     let rows = Math.floor(req.query.rows) || 10 ;   //每页显示条数
     let index = Math.floor(req.query.index) || 1;   //当前页数

     switch(blogType)
     { 
     	case 1:
     	   console(12)
     	   blogType = '前端';
     	   break;
     	case 2:
     	   blogType = '后台';
     	   break;
     	case 3:
     	   blogType = '设计';
     	   break;
     	case 4:
     	   blogType = '生活';
     	   break;
     	case 5:
     	   blogType = '艺术';
     	   break;
     }
     if(blogType == 1){

     	 blogType = '前端';

     }else if(blogType ==2){
        
         blogType = '后台';   

     }else if(blogType ==3){
        
         blogType = '设计'; 

     }else if(blogType ==4){   

         blogType = '生活';    

     }else if(blogType ==5){
        
         blogType = '艺术';    
     }

     console.log(blogType)

     article.count({blogType:blogType},(err,doc)=>{
     	   pagesize = doc;
     })

     article.find({blogType:blogType},(err,doc)=>{
            if(err){
	            var data = {
	                code:500,
	                msg:"查询失败"
	            }
		     }else{
		            let n = Math.ceil(pagesize / rows);  //总共多少页
		            var data = {
		                code:200,
		                msg:"查询成功",
		                totalItem:pagesize, //总条数
		                totalPage:n, //总共多少页
		                rows:rows,//每页显示多少条
		                index:index,//当前页数
		                result:doc
		            }
		     }
	        res.json({
	            result:data
	        })
      }).sort({"time": -1}).skip((index - 1) * rows).limit(rows);
  }